#!/usr/bin/python
# -*- coding: utf-8 -*-

from threading import Thread


class ThreadResult(Thread):
    def __init__(self, func, *args, **kwargs):
        Thread.__init__(self)
        self._func = func
        self._args = args
        self._kwargs = kwargs
        self._result = None

    def run(self):
        self._result = self._func(*self._args, **self._kwargs)

    def get_result(self):
        return self._result
